﻿﻿<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="./dist/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>

<head>
	<!-- 引入 Bootstrap -->
	<link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="icon" href="../../favicon.ico">
	<!-- Bootstrap core CSS -->
	<link href="dist/css/bootstrap.min.css" rel="stylesheet">
	<!-- Custom styles for this template -->
	<link href="navbar.css" rel="stylesheet">

</head>

<?php
	require	("Include/conn.php");
?>

<body  background="img/bg.png">

<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<div class="carousel slide" id="carousel-619174">
				<ol class="carousel-indicators">
					<li data-slide-to="0" data-target="#carousel-619174">
					</li>
					<li data-slide-to="1" data-target="#carousel-619174">
					</li>
					<li data-slide-to="2" data-target="#carousel-619174">
					</li>
				</ol>
				<div class="carousel-inner">
					<div class="item">
						<img alt="" src="img/1001.jpg" /> 
						<div class="carousel-caption">
							<h4>

							</h4>
							<p>

							</p>
						</div>
					</div>
					<div class="item active left">
						<img alt="" src="img/1002.jpg" />
						<div class="carousel-caption">
							<h4>

							</h4>
							<p>

							</p>
						</div>
					</div>
					<div class="item next left">
						<img alt="" src="img/1003.jpg" />
						<div class="carousel-caption">
							<h4>

							</h4>
							<p>

							</p>
						</div>
					</div>
				</div> <a data-slide="prev" href="#carousel-619174" class="left carousel-control">‹</a> <a data-slide="next" href="#carousel-619174" class="right carousel-control">›</a>
			</div>
			<div>
				<?php
				if(!empty($_COOKIE['user_id'])) {
					$sql = "SELECT `user_name` FROM `pw_user` WHERE `user_id`=" . $_COOKIE['user_id'];
					$user_name = mysqli_fetch_array(mysqli_query($link, $sql))['user_name'];
					echo "<h3 style=\"color:red \">
								$user_name   欢迎你！
							</h3>
						";
				}
				?>
			</div>
			<ul class="nav nav-tabs">
				<li class="active">
					<a href="index.php">首页</a>
				</li>

				<?php
					if(!empty($_COOKIE['user_id'])){
						$sql="SELECT `user_name` FROM `pw_user` WHERE `user_id`=".$_COOKIE['user_id'];
						$user_name=mysqli_fetch_array(mysqli_query($link,$sql))['user_name'];

						echo"<li>
								<a href=\"user.php\">我的主页</a>
							 </li>
							 <li>
								<a href=\"#\">留言板</a>
							 </li>
							 ";
					}
				?>
				<li class="dropdown pull-right">

				</li>
				<?php
					if(!empty($_COOKIE['user_id'])){
						echo "<li class=\"dropdown pull-right\">
								<a href = \"exit.php\">注销</a>
				          	   </li>";
					}
					else{
						echo "<li class=\"dropdown pull-right\">
									<a href = \"login.php\">登录</a>
				          	</li>;
						  	<li class = \"dropdown pull-right\">
									<a href=\"register.php\">注册</a>
						 	 </li>";
					}
				?>
			</ul>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<form class="form-search" action = "search.php" methon = "post">
				<input class="input-medium search-query" type="text" name = "pic_name" /><button class="btn" type="submit">查找</button>
			</form>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<h3>
				<em>最新作品</em>
			</h3>
			<?php
				include ("picprint.php");
				$sql = "SELECT `pic_id` FROM `pw_pic` WHERE `pic_stat`=1 ORDER BY pic_time DESC LIMIT 8;";
				$result = mysqli_query($link,$sql);
				for($i=0;$i<8;$i++){
					$row[$i]=mysqli_fetch_row($result);
				}
				rowpic($row[0][0],$row[1][0],$row[2][0],$row[3][0]);
				rowpic($row[4][0],$row[5][0],$row[6][0],$row[7][0]);
			?>

			<h3>
				<em>热门图片</em>
			</h3>
			<?php
			$sql = "SELECT `pic_id` FROM `pw_pic` WHERE `pic_stat`=1 ORDER BY pic_click DESC LIMIT 8;";
			$result = mysqli_query($link,$sql);
			for($i=0;$i<8;$i++){
				$row[$i]=mysqli_fetch_row($result);
			}
			rowpic($row[0][0],$row[1][0],$row[2][0],$row[3][0]);
			rowpic($row[4][0],$row[5][0],$row[6][0],$row[7][0]);
			?>
		</div>
	</div>
</div>

</body>